//
//  SecondScene.m
//  CodeForConstrain
//
//  Created by 李明明 on 15/10/16.
//  Copyright © 2015年 李明明. All rights reserved.
//

#import "SecondScene.h"
#import "SecondCell.h"

@interface SecondScene ()<UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, weak) IBOutlet UICollectionView *collectionView;
@end

@implementation SecondScene

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    SecondCell *cell = (SecondCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"secondcellreuse" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor redColor];
    [cell loadInfo:[NSString stringWithFormat:@"%zd", indexPath.item % 9]];
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%zd", indexPath.item % 9);
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 18;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
